package com.tianqi.common.enums;

/**
 * 小六壬地盘名称
 *
 * @author zhangzedi
 * @date 2023/8/21 21:59
 **/
public enum LittleLiuRenPanEnum {
	DAAN(1, "大安"),

	LIU_LIAN(2, "留连"),

	SU_XI(3, "速喜"),

	CHI_KOU(4, "赤口"),

	XIAO_XI(5, "小喜"),

	KONG_WANG(6, "空亡");

	/**
	 * 地盘下标
	 */
	private Integer index;

	/**
	 * 地盘名称
	 */
	private String name;

	/**
	 * 根据下标获取名称
	 *
	 * @param index
	 * @return
	 */
	public static String getNameByIndex(Integer index) {
		LittleLiuRenPanEnum[] values = LittleLiuRenPanEnum.values();
		for (LittleLiuRenPanEnum value : values) {
			if (index.equals(value.index)) {
				return value.name;
			}
		}
		return null;
	}

	LittleLiuRenPanEnum(Integer index, String name) {
		this.index = index;
		this.name = name;
	}
}
